| Author |
Thread Statistics | Show CCP posts - 1 post(s) |

TL Castiel
Federal Defence Union Gallente Federation
8
|
Posted - 2011.11.04 14:57:00 -
[1] - Quote
Hello everyone,
I just took in this semester Computer Networks I and our task right now is to examine an existing server application and give a report on how they work. Many choose Apache, some chose ProFTPd and so on... So our task is to look at different ways to handle TCP connections and later write a TCP server and client that follows that approach.
So I decided to go a bit... more technical and try and look at some Game Server's Server side source code. I found none thus I will most likely write my own report on some open source application's design however I became interested:
Creating a blocking IO model based TCP server just doesn't seem viable with so much net traffic going on. Imagine that there is a blocking IO based TCP server listening at CCP's side and whenever there is something happening on client side all the other clients have to wait for the first client's network connection to finish. With a few hundred connections I can imagine that that could be fast enough but with 40-50.000?
So I came to the conclusion that it must be a non blocking IO and async TCP server at CCP's side. So whenever a client connects he either gets a thread to handle his connection or gets a connection resource from a pool. I very much doubt that CCP would want 40-50000 threads running on their servers since that would mean a lot of context changes that takes up a lot of CPU time and memory. Another problem with Async IO is: the execution order of the threads are not dependent on the time they were created so they have no way to ensure say a FiFo order of execution. Depends on the OS scheduler. Imagine what would happen if say you hit warp and a little later you opponent in PVP hits on the scrambler. In a real world scenario I'd imagine that warp should be executed first and you stay alive, but it is entirely possible that client 2's scram request gets executed first. You are doomed O_o If Async IO is used how do they ensure this FiFo stack of events?
I heard some rumors that CCP is using microthreads with stackless python. Would a python application have the power to serve so many connections? As well that would mean that the application would have to run on a single core over multiple cores. Not very ... efficient...
Cluster to serve 1 universe
Another thing that just came to me while not related to my original problem but is still interesting: Whenever there is an event on client side: say you hit on F1 through F8 to kill that SoB, the server gets notified of it. There are a lot of such events occurring concurrently. 1 Server would not be unable to keep up with all that information to be processed so they need a lot of servers in a cluster. This is actually what CCP has.. I am wondering tho how they solved the issue of having a computer's core dedicated to a solar system. There must be an entry server that deserializes the object that has been sent over to the cluster and forwards that "message" to the appropriate execution node which in turn will add it to a "message" stack and do what needs to be done and sends back the response. As far as I know CCP uses a gzipped python pickle's for this purpose. I'd love a field trip at CCP's HQ. :) hehe |

TL Castiel
Federal Defence Union Gallente Federation
8
|
Posted - 2011.11.04 16:58:00 -
[2] - Quote
Don't worry, your pseudo code was perfectly understandable.
I figured that EVE is using the latter, so the async way. There is only the question remaining how they maintain the FiFo order of things. I suppose that is the task of the proxy servers, to unmarshal or deserialize the data that is received and decide which one goes first?
Edit: found a few dev blogs: http://www.eveonline.com/devblog.asp?a=blog&bid=286 http://www.eveonline.com/devblog.asp?a=blog&bid=678 |

TL Castiel
Federal Defence Union Gallente Federation
8
|
Posted - 2011.11.04 17:12:00 -
[3] - Quote
That just sais stackless IO. Where do you get your information from that each connection is handled separately? |
| |
|